package com.sprider.jsoup.service.impl;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import com.sprider.jsoup.service.SpriderAbstractService;
import com.sprider.model.RegionModel;

public class RegionSpriderService extends SpriderAbstractService {

	@Override
	protected Object parse() {
		Elements els=this.doc.select(".box.w_d a");
		List<RegionModel> list=new ArrayList<RegionModel>();
		Iterator<Element> it=els.iterator();
		while(it.hasNext()){
		Element el=it.next();
			String regionDomain=el.attr("href");
			String regionName=el.html();
			RegionModel model=new RegionModel();
			model.setRegionName(regionName);
			model.setRegionDomain(regionDomain);
			list.add(model);
		}
		return list;
	}

}
